/**
 *@ClassName LoopAndRange
 *
 *@Author ykx
 *@Date  2024/6/17 16:04
 *@Version 1.0
 */
fun main(args: Array<String>) {
    // val nums = 1..100 // [1,100]
    val nums = 1 until 100 // [1,100)
    var result = 0
    for (num in nums) {
        result += num
    }
    println(result)

    val num2 = 1..50
    for (i in num2 step 2) {
        print("$i,")
    }
    println()
    val num3 = num2.reversed()
    for (i in num3) {
        print("$i,")
    }
    println(num3.count())
}
